﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ManageBanking.Models
{
    public class NewsModels
    {
        private OnlineBankingDataContext olbk = new OnlineBankingDataContext();
         public NewsBanking DetailNews (int idnews)
         {
            return olbk.NewsBankings.Where(n=>n.idnews==idnews).First();
         }

         public List<NewsBanking> ListNews()
         {
             return olbk.NewsBankings.ToList(); 
         }

         public List<NewsBanking> OtherNews(int idnews)
         { 
             return olbk.NewsBankings.Where(n=>n.idnews != idnews).Skip(0).Take(5).ToList(); 
         }
    }
}
